<html>
<head><meta charset="utf-8"><title>RUSTC_LOG output get somehow &quot;recorded&quot; · t-compiler · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/index.html">t-compiler</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html">RUSTC_LOG output get somehow &quot;recorded&quot;</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="202003776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202003776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202003776">(Jun 25 2020 at 18:04)</a>:</h4>
<p>Today i found a strange thing. I set RUSTC_LOG to debug when i build the compile, and lots of log information come out. Then i set it to empty, and do an incremental build on top of that, the log information is still coming out. Are those somehow recorded somewhere?</p>



<a name="202004089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004089">(Jun 25 2020 at 18:07)</a>:</h4>
<p>I thought <code>RUSTC_LOG</code> is a variable you pass at runtime and not compile-time?</p>



<a name="202004151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004151">(Jun 25 2020 at 18:08)</a>:</h4>
<p>I think that to remove the debug info you need to change your <code>config.toml</code> and set <code>debug-assertions = false</code>.</p>



<a name="202004295"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004295" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004295">(Jun 25 2020 at 18:08)</a>:</h4>
<p>See <a href="https://rustc-dev-guide.rust-lang.org/compiler-debugging.html#getting-logging-output">this part</a> of the rustc-dev-guide</p>



<a name="202004420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Léo Lanteri Thauvin <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004420">(Jun 25 2020 at 18:09)</a>:</h4>
<blockquote>
<h3>How to keep or remove debug! and trace! calls from the resulting binary</h3>
<p>While calls to error!, warn! and info! are included in every build of the compiler, calls to debug! and trace! are only included in the program if debug-assertions=yes is turned on in config.toml (it is turned off by default), so if you don't see DEBUG logs, especially if you run the compiler with RUSTC_LOG=rustc rustc <a href="http://some.rs">some.rs</a> and only see INFO logs, make sure that debug-assertions=yes is turned on in your config.toml.</p>
<p>In some cases, just setting it will not trigger a rebuild, so if you changed it and you already have a compiler built, you might want to call x.py clean to force one.</p>
</blockquote>



<a name="202004768"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004768" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004768">(Jun 25 2020 at 18:12)</a>:</h4>
<p>I think this is not about <code>config.toml</code> since i haven't change it recently.</p>



<a name="202004831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004831">(Jun 25 2020 at 18:12)</a>:</h4>
<p>I set the variable actually just wanting to see the internal compiler debug output of a unit test running.</p>



<a name="202004893"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202004893" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202004893">(Jun 25 2020 at 18:13)</a>:</h4>
<p>And it worked... however the output of the building part is somehow "recorded" i think...</p>



<a name="202013065"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202013065" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202013065">(Jun 25 2020 at 19:20)</a>:</h4>
<p>Cargo caches the compiler diagnostics and replays them, presumably that also records log output?</p>



<a name="202015779"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202015779" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202015779">(Jun 25 2020 at 19:44)</a>:</h4>
<p>yeah I think cargo caches all stderr/stdout from compiler, or at least stderr for that</p>



<a name="202015791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202015791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202015791">(Jun 25 2020 at 19:44)</a>:</h4>
<p>(note this means large files, potentially)</p>



<a name="202044338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202044338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Charles Lew <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202044338">(Jun 26 2020 at 01:33)</a>:</h4>
<p>Thanks! I think that's indeed the case. And it's about 21MB text output in my case. I'm curious where is that information stored? Is there a way to remove/force regenerate that information without breaking the incremental compilation state?</p>



<a name="202159454"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/131828-t-compiler/topic/RUSTC_LOG%20output%20get%20somehow%20%22recorded%22/near/202159454" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/131828-t-compiler/topic/RUSTC_LOG.20output.20get.20somehow.20.22recorded.22.html#202159454">(Jun 27 2020 at 00:51)</a>:</h4>
<p><a href="https://github.com/rust-lang/cargo/issues/8374">https://github.com/rust-lang/cargo/issues/8374</a></p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>